﻿#ifndef FILEMODEL_H
#define FILEMODEL_H

#include <QString>
#include <QDebug>
#include <model/filetree.h>

class FileModel : public QObject {
    Q_OBJECT
    Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChange)

    Q_PROPERTY(QString fullPath READ fullPath WRITE setFullPath NOTIFY fullPathChange) // 全路径

    Q_PROPERTY(QString type READ type WRITE setType NOTIFY typeChange)
    Q_PROPERTY(int tab READ tab WRITE setTab NOTIFY tabChange)



public:
    // FileModel(FileTree* tree);
    FileModel(QString n, QString f, QString type, int t);
    ~FileModel(){
        // qDebug()<<"析构";
    };
    QString m_name;
    QString name();
    void setName(QString n);

    QString m_type;
    QString type(){return m_type;};
    void setType(QString t){this->m_type = t;};

    int m_tab;
    int tab(){return m_tab;};
    void setTab(int t){this->m_tab = t;};


    QString m_fullPath;
    QString fullPath(){return m_fullPath;};
    void setFullPath(QString t){this->m_fullPath = t;};

    QList<FileModel*> childs;
    bool visible = false;


signals:
    void nameChange();
    void typeChange();
    void tabChange();

    void fullPathChange();


};


#endif // FILEMODEL_H
